/**
 * 
 */
package org.mhz.sit.app;

import java.net.URL;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Paint;
import javafx.stage.Stage;

import org.mhz.sit.util.Constants;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Mahan
 *
 * SpeakInTime application
 */
public class SpeakInTime extends Application
{
    
    /**
     * Main method
     *
     * @param aArgs - Arguments to pass
     */
    public static void main(String[] aArgs) 
    {
        try
        {
            final ApplicationContext context = new ClassPathXmlApplicationContext("application-context.xml");
            
            launch(aArgs);
        }
        catch (Throwable throwable)
        {
            throwable.printStackTrace();
        }
    }    

	/* (non-Javadoc)
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
	@Override
	public void start(final Stage aStage) throws Exception 
	{
		final URL url = getClass().getClassLoader().getResource(Constants.SPEAK_IN_TIME_FXML);
        final Parent root = FXMLLoader.load(url);
        
        aStage.setTitle(Constants.SPEAK_IN_TIME_TITLE);
        final Scene scene = new Scene(root, Paint.valueOf(Constants.BACKGROUND));
        scene.getStylesheets().add(Constants.MAIN_STYLESHEET);
        aStage.setScene(scene);
        aStage.show();    
	}

}
